package fm.dongman.modellib.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

import fm.dongman.animefm.contractlib.IModel;

/**
 * 漫单模型
 * Created by Admin on 2017/9/28.
 */

public class SheetModel implements IModel.ISheetModel {

    //创建时间
    private String mCreateTime;

    //漫单标题
    private String mMandanTitle;

    //漫单id
    private String mMandanId;

    //用户头像
    private String mAvatarUrl;

    //用户id
    private String mUserId;

    //用户名
    private String mUserName;

    //数量
    private String mNum;

    //简介
    private String mSummary;

    //番剧数
    private String mBangumiCount;

    //浏览次数
    private String mBrowseCount;

    //收藏数
    private String mCollectCount;

    //漫单图片
    private String mMandanImg;

    //动漫数量
    private int mAnimeCount;

    //是否已经收藏
    private int mIsCollected;

    //内容
    private String mContent;

    //类型：是漫单还是专题
    private String mType;

    private UserModel mUser;

    private List<IModel.IComicModel> mMandaList;

    public SheetModel() {

    }

    public SheetModel(String mCreateTime, String mMandanTitle, String mMandanId, String mAvatarUrl,
                      String mUserId, String mUserName, String mNum, String mSummary,
                      String mCollectCount, String mBrowseCount, String mBangumiCount, String mMandanImg) {
        this.mCreateTime = mCreateTime;
        this.mMandanTitle = mMandanTitle;
        this.mMandanId = mMandanId;
        this.mAvatarUrl = mAvatarUrl;
        this.mUserId = mUserId;
        this.mUserName = mUserName;
        this.mNum = mNum;
        this.mSummary = mSummary;
        this.mCollectCount = mCollectCount;
        this.mBrowseCount = mBrowseCount;
        this.mBangumiCount = mBangumiCount;
        this.mMandanImg = mMandanImg;
    }

    public boolean isMandan() {
        return mType != null && mType.equals("mandan");
    }

    public String getMandanImg() {
        return mMandanImg;
    }

    public void setMandanImg(String mandanImg) {
        mMandanImg = mandanImg;
    }

    public String getBangumiCount() {
        return mBangumiCount;
    }

    public void setBangumiCount(String bangumiCount) {
        mBangumiCount = bangumiCount;
    }

    public String getBrowseCount() {
        return mBrowseCount;
    }

    public void setBrowseCount(String browseCount) {
        mBrowseCount = browseCount;
    }

    public String getCollectCount() {
        return mCollectCount;
    }

    public void setCollectCount(String collectCount) {
        mCollectCount = collectCount;
    }

    public String getCreateTime() {
        return mCreateTime;
    }

    public void setCreateTime(String createTime) {
        mCreateTime = createTime;
    }

    public String getContent() {
        return mContent;
    }

    public void setContent(String content) {
        mContent = content;
    }

    public String getMandanTitle() {
        return mMandanTitle;
    }

    public void setMandanTitle(String mandanTitle) {
        mMandanTitle = mandanTitle;
    }

    public String getMandanId() {
        return mMandanId;
    }

    public List<IModel.IComicModel> getmMandaList() {
        return mMandaList;
    }

    public void setmMandaList(List<IModel.IComicModel> mMandaList) {
        this.mMandaList = mMandaList;
    }

    public void setMandanId(String mandanId) {
        mMandanId = mandanId;
    }

    public int getmIsCollected() {
        return mIsCollected;
    }

    public void setmIsCollected(int mIsCollected) {
        this.mIsCollected = mIsCollected;
    }

    public String getAvatarUrl() {
        return mAvatarUrl;
    }

    public void setAvatarUrl(String avatarUrl) {
        mAvatarUrl = avatarUrl;
    }

    public String getUserId() {
        return mUserId;
    }

    public void setUserId(String userId) {
        mUserId = userId;
    }

    public String getUserName() {
        return mUserName;
    }

    public void setUserName(String userName) {
        mUserName = userName;
    }

    public String getNum() {
        return mNum;
    }

    public void setNum(String num) {
        mNum = num;
    }

    public String getSummary() {
        return mSummary;
    }

    public void setSummary(String summary) {
        mSummary = summary;
    }

    public String getType() {
        return mType;
    }

    public void setType(String type) {
        this.mType = type;
    }

    public UserModel getUser() {
        return mUser;
    }

    public void setUser(UserModel user) {
        this.mUser = user;
    }

    public int getAnimeCount() {
        return mAnimeCount;
    }

    public void setAnimeCount(int animeCount) {
        mAnimeCount = animeCount;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(mCreateTime);
        dest.writeString(mMandanTitle);
        dest.writeString(mMandanId);
        dest.writeString(mAvatarUrl);
        dest.writeString(mUserId);
        dest.writeString(mUserName);
        dest.writeString(mNum);
        dest.writeString(mSummary);
        dest.writeString(mCollectCount);
        dest.writeString(mBangumiCount);
        dest.writeString(mBrowseCount);
        dest.writeString(mMandanImg);
    }

    public static Parcelable.Creator<SheetModel> CREATOR = new Creator<SheetModel>() {
        @Override
        public SheetModel createFromParcel(Parcel source) {
            SheetModel model = new SheetModel();
            model.setCreateTime(source.readString());
            model.setMandanTitle(source.readString());
            model.setMandanId(source.readString());
            model.setAvatarUrl(source.readString());
            model.setUserId(source.readString());
            model.setUserName(source.readString());
            model.setNum(source.readString());
            model.setSummary(source.readString());
            model.setCollectCount(source.readString());
            model.setBangumiCount(source.readString());
            model.setBrowseCount(source.readString());
            model.setMandanImg(source.readString());
            return model;
        }

        @Override
        public SheetModel[] newArray(int size) {
            return new SheetModel[size];
        }
    };
}
